/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.dao;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import sunsite.po.Sai;

/**
 *
 * @author Ruby
 */
public class SaiDaoImpl extends HibernateDaoSupport implements sunsite.dao.SaiDao{

    public List<sunsite.po.Sai> getSaiList() {
        return getHibernateTemplate().find("from Sai");
    }

    public sunsite.po.Sai getSai(int saiId) {
        return (sunsite.po.Sai)getHibernateTemplate().get(Sai.class, saiId);
    }

    public void add(Sai sai) {
        getHibernateTemplate().save(sai);
    }

    public void delete(int saiId) {
        getHibernateTemplate().delete(new Sai(saiId));
    }

    public void update(sunsite.dao.SaiDao sai) {
        getHibernateTemplate().update(sai);
    }

}
